package com.edu.elasticsearch;

import org.elasticsearch.search.sort.SortOrder;

public class ESQueryBean {
	
	private int page;//页码
	private int size;//分页大小
	private String orderField;//排序字段
	private SortOrder sortOrder;//排序方式 SortOrder.DESC
	
	public ESQueryBean(){}
	
	public ESQueryBean(int page,int size,String orderField,SortOrder sortOrder){
		this.page = page;
		this.size = size;
		this.orderField = orderField;
		this.sortOrder = sortOrder;
	}
	
	public int getPage() {
		return page;
	}
	public void setPage(int pPage) {
		page = pPage;
	}
	public int getSize() {
		return size;
	}
	public void setSize(int pSize) {
		size = pSize;
	}
	public String getOrderField() {
		return orderField;
	}
	public void setOrderField(String pOrderField) {
		orderField = pOrderField;
	}
	public SortOrder getSortOrder() {
		return sortOrder;
	}
	public void setSortOrder(String pSortOrder) {
		if(pSortOrder.equals("desc")){
			sortOrder = SortOrder.DESC;
		}else{
			sortOrder = SortOrder.ASC;
		}
	}
	

}
